class UsersController < ApplicationController
  # Be sure to include AuthenticationSystem in Application Controller instead
  #include AuthenticatedSystem
  layout "general"
  # render new.rhtml
  def new
  end

  def create
    @user = User.new(params[:user])
    @user.save!
    
    bc = Broadcast.create(:site => 1, :from=>0, :to=>0, :content=>"欢迎 <a href=\"#{user_path(@user)}\">#{@user.login}</a> 注册为多背一公斤志愿者，参加放假多背一公斤活动")
    
    self.current_user = @user
    redirect_back_or_default('/')
    #flash[:notice] = "谢谢您注册为GatherLove会员 :)"
  rescue ActiveRecord::RecordInvalid
    render :action => 'new'
  end

  def show
    @user = User.find(params[:id], :include => :profile)
    respond_to do |format|
      format.html
    end
  end
end
